/*
 * @Author: your name
 * @Date: 2021-03-02 09:46:29
 * @LastEditTime: 2021-05-13 11:57:39
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \admin_front_end\src\api\user.js
 */
import { axios } from '@/utils/request'

const api = {
  getList: '/user/list',
  getAdminUser: '/user/admin-user',
  updateUserInfo: '/user/update-info',
  getLevelList: '/user/level-list',
  updateLevelStatus: 'user/level-status',
  updateLevelInfo: 'user/update-level-info',
  deleteLevel: '/user/delete-level',
  levelOrder: '/user/level-order',
  selectUserList: '/user/select-list',
  addAdmin: '/user/add-admin',
  delAdmin: '/user/del-admin',
  userDels: '/user/del-admin',
  storeUserList: '/user/get-user-list',
  setParent: '/user/set-parent',
  getAllLevelList: '/user/all-level-list',
  userDefaultInfo: '/user/user-default-info',
}

export default api

export function storeUserList (parameter) {
  return axios({
    url: api.storeUserList,
    method: 'get',
    params: parameter
  })
}
export function getUserList (parameter) {
  return axios({
    url: api.getList,
    method: 'get',
    params: parameter
  })
}

export function getAdminUser (parameter) {
  return axios({
    url: api.getAdminUser,
    method: 'get',
    params: parameter
  })
}

export function updateUserInfo (parameter) {
  return axios({
    url: api.updateUserInfo,
    method: 'post',
    data: parameter
  })
}

export function getLevelList (parameter) {
  return axios({
    url: api.getLevelList,
    method: 'get',
    params: parameter
  })
}
export function getAllLevelList (parameter) {
  return axios({
    url: api.getAllLevelList,
    method: 'get',
    params: parameter
  })
}

export function updateLevelStatus (parameter) {
  return axios({
    url: api.updateLevelStatus,
    method: 'post',
    data: parameter
  })
}

export function updateLevelInfo (parameter) {
  return axios({
    url: api.updateLevelInfo,
    method: 'post',
    data: parameter
  })
}

export function deleteLevel (parameter) {
  return axios({
    url: api.deleteLevel,
    method: 'post',
    data: parameter
  })
}

export function levelOrder (parameter) {
  return axios({
    url: api.levelOrder,
    method: 'get',
    params: parameter
  })
}

export function getSelectUserList (parameter) {
  return axios({
    url: api.selectUserList,
    method: 'get',
    params: parameter
  })
}

export function addAdmin (parameter) {
  return axios({
    url: api.addAdmin,
    method: 'get',
    params: parameter
  })
}

export function delAdmin (parameter) {
  return axios({
    url: api.delAdmin,
    method: 'get',
    params: parameter
  })
}

export function userDels (parameter) {
  return axios({
    url: api.userDels,
    method: 'post',
    params: parameter
  })
}

export function setParent (parameter) {
  return axios({
    url: api.setParent,
    method: 'post',
    data: parameter
  })
}
export function userDefaultInfo (parameter) {
  return axios({
    url: api.userDefaultInfo,
    method: 'post',
    data: parameter
  })
}
export function getUserDefaultInfo (parameter) {
  return axios({
    url: api.userDefaultInfo,
    method: 'get',
    params: parameter
  })
}
